<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="format-detection" content="telephone=no">
		<title>事项中心详情</title>
		<link rel="stylesheet" href="<c:url value='/resource/wechat/css/frozen.css'></c:url>">
		<link rel="stylesheet" href="<c:url value='/resource/wechat/css/main.css'></c:url>">
		<script src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
		<script src="<c:url value="/resource/js/jquery.serializejson.min.js"></c:url>"></script>
		<script src="<c:url value="/resource/js/jweixin-1.1.0.js"></c:url>"></script>
	</head>
	<body class="body_bg" ontouchstart>

        <section class="ui-container">
			<ul class="ul_lost" style="margin-bottom: 15px;">
				<li>
						<h1 class="h1_text" style="width: 100%;color: #2775fb; font-size: 18px; text-indent: 10px; ">${caseInfo.caseName}</h1>
				</li>
				<li>
					<div class="lf80">
						审批主体：
					</div>
					<div class="rt_80">
						${caseInfo.orgName}
					</div>
				</li>
				<c:if test="${caseBasisList != null}">
				<li>
					<div class="lf80">
						设定依据：
					</div>
					<div class="rt_80">
						<c:forEach var="caseBasis" items="${caseBasisList}" varStatus="vs">
							${caseBasis.basisName}<br/>
						</c:forEach>
					</div>
				</li>
				</c:if>
				<c:if test="${caseMeterialList != null}">
				<li>
					<div class="lf80">
						申报材料：
					</div>
					<div class="rt_80">
						<c:forEach var="caseMeterial" items="${caseMeterialList}" varStatus="vs">
						${vs.index+1}.${caseMeterial.meterialName}<br />
						</c:forEach>
					</div>
				</li>
				</c:if>
				<li>
					<div class="lf80">
						事项性质：
					</div>
					<div class="rt_80">
						${caseInfo.caseKindName}
					</div>
				</li><li>
					<div class="lf80">
						办理地点：
					</div>
					<div class="rt_80">
						${caseInfo.toPlace}
					</div>
				</li><li>
					<div class="lf80">
						办件类型：
					</div>
					<div class="rt_80">
						${caseInfo.caseTypeName}
					</div>
				</li><li>
					<div class="lf80">
						办理时间：
					</div>
					<div class="rt_80">
						${caseInfo.workDateTime}
					</div>
				</li><li>
					<div class="lf80">
						承诺期限：
					</div>
					<div class="rt_80">
						${caseInfo.promiseDays}个工作日
					</div>
				</li>

			</ul>
			 <div class="ui-btn-wrap">
					 <c:if test="${expertneturl ne '' && (caseInfo.caseProptery eq '3' || caseInfo.caseProptery eq '4')}">
						 <input type="hidden" name="userGuid" value="${userGuid}">
						 <button class="ui-btn-lg ui-btn-primary"
								 onclick="_submit()">
							 在线预约
						 </button>
					 </c:if>

					 <c:if test="${(caseInfo.caseProptery eq '3' || caseInfo.caseProptery eq '4') && userGuid ne '0' && expertneturl eq ''}">
						 <c:if test="${rzResult!='1'}"> <button class="ui-btn-lg ui-btn-primary" onclick="subm();">
							 在线预约
						 </button></c:if>
				 <c:if test="${rzResult=='1'}">
						 <form method="post" id="forms1" class="forms">
							 <input type="hidden" name="caseNo" value="${caseNo}">
							 <input type="hidden" name="orgid" value="${orgid}">
							 <input type="hidden" name="userGuid" value="${userGuid}">
							 <input type="hidden" name="pt" value="${pt}">
							 <button class="ui-btn-lg ui-btn-primary" onclick="submits();">
								 在线预约
							 </button>
						 </form>
				 </c:if>
					 </c:if>
				 	 <br/>
					 <c:if test="${expertneturl ne '' && (caseInfo.caseProptery eq '2' || caseInfo.caseProptery eq '4')}">
						 <input type="hidden" name="userGuid" value="${userGuid}">
						 <button class="ui-btn-lg ui-btn-primary"
								 onclick="_submit()">
							 申报
						 </button>
					 </c:if>

					 <c:if test="${(caseInfo.caseProptery eq '2' || caseInfo.caseProptery eq '4') && userGuid ne '0' && expertneturl eq '' }">
					<c:if test="${rzResult!='1'}"> <button class="ui-btn-lg ui-btn-primary" onclick="subm();">
						申报
					</button></c:if>
				 <c:if test="${rzResult=='1'}">
							 <form method="post" id="forms2" class="forms">

								 <input type="hidden" name="caseNo" value="${caseNo}">
								 <input type="hidden" name="orgid" value="${orgid}">
								 <input type="hidden" name="userGuid" value="${userGuid}">
								 <input type="hidden" name="pt" value="${pt}">
								 <button class="ui-btn-lg ui-btn-primary" onclick="submits();">
									 申报
								 </button>
							 </form>
				 </c:if>
					 </c:if>
			</div>
		</section>

		<script type="application/javascript">


			$( function(){

				if('1'=='${rzResult}'){
				if("${caseInfo.caseProptery}" == "3" || "${caseInfo.caseProptery}" == "4") {
					$("#forms1").attr("action", "<c:url value='/api/case/order'></c:url>");
				}
				if("${caseInfo.caseProptery}" == "2"|| "${caseInfo.caseProptery}" == "4") {
					$("#forms2").attr("action", "<c:url value='/api/case/goToApply'></c:url>");
				}}
			})
			function submits(){
				if(''=='${userGuid}'||null=='${userGuid}'||'(null)'=='${userGuid}'){
					var ua = navigator.userAgent.toLowerCase();
					if (ua.match(/MicroMessenger/i) == 'micromessenger') {
						window.location.href="<c:url value='/weixin/wx_member/login'/>" + "?gowhere=/api/case/index&openId=${openId}";
					}
					else {
						if (/iphone|ipad|ipod/.test(ua)) {
							toClient();
						} else if (/android/.test(ua)) {
							window.webdemo.toClient();
						}
					}
				}
				 else if("1"=="${rzResult}"){
					if("${caseInfo.caseProptery}" == '3' || "${caseInfo.caseProptery}" == '4') {
						$("#forms1").submit();
					}
					if("${caseInfo.caseProptery}" == '2' || "${caseInfo.caseProptery}" == '4') {
						$("#forms2").submit();
					}
				}
			}
			function _submit(){
				if(''=='${userGuid}'||null=='${userGuid}'||'(null)'=='${userGuid}'){
					var ua = navigator.userAgent.toLowerCase();
						if (ua.match(/MicroMessenger/i) == 'micromessenger') {

					window.location.href = "<c:url value='/weixin/wx_member/login'/>" + "?gowhere=/api/case/index&openId=${openId}" ;
							}
						else {
							if (/iphone|ipad|ipod/.test(ua)) {
								toClient();
							} else if (/android/.test(ua)) {
								window.webdemo.toClient();
							}
						}
				}else if("1"=="${rzResult}"){
					window.location.href='${expertneturl}';
				}else {
					alert("您的账号未通过实名认证，请至[个人中心]进行实名认证。");
					var ua = navigator.userAgent.toLowerCase();
					if (ua.match(/MicroMessenger/i) == 'micromessenger') {
					window.location.href="http://gawx.daqing.gov.cn/econsole/weixin/wx_member/baseOauth?url=http://gawx.daqing.gov.cn/econsole/weixin/percenter/index";
					}
				}
			}
			function subm(){

				if(''=='${userGuid}'||null=='${userGuid}'||'(null)'=='${userGuid}'){
					var ua = navigator.userAgent.toLowerCase();
					if (ua.match(/MicroMessenger/i) == 'micromessenger') {
						window.location.href="<c:url value='/weixin/wx_member/login'/>" + "?gowhere=/api/case/index&openId=${openId}";
					}
					else {
						if (/iphone|ipad|ipod/.test(ua)) {
							toClient();
						} else if (/android/.test(ua)) {
							window.webdemo.toClient();
						}
					}
				}else{
				alert("您的账号未通过实名认证，请至[个人中心]进行实名认证。");
					var ua = navigator.userAgent.toLowerCase();
					if (ua.match(/MicroMessenger/i) == 'micromessenger') {
						window.location.href="http://gawx.daqing.gov.cn/econsole/weixin/wx_member/baseOauth?url=http://gawx.daqing.gov.cn/econsole/weixin/percenter/index";
					}
			}}

		</script>
	</body>

</html>